<!DOCTYPE html><html><head>
<title>html - HTML Generation</title>
<style type="text/css"><!--
    HTML {
	background: 	#FFFFFF;
	color: 		black;
    }
    BODY {
	background: 	#FFFFFF;
	color:	 	black;
    }
    DIV.doctools {
	margin-left:	10%;
	margin-right:	10%;
    }
    DIV.doctools H1,DIV.doctools H2 {
	margin-left:	-5%;
    }
    H1, H2, H3, H4 {
	margin-top: 	1em;
	font-family:	sans-serif;
	font-size:	large;
	color:		#005A9C;
	background: 	transparent;
	text-align:		left;
    }
    H1.doctools_title {
	text-align: center;
    }
    UL,OL {
	margin-right: 0em;
	margin-top: 3pt;
	margin-bottom: 3pt;
    }
    UL LI {
	list-style: disc;
    }
    OL LI {
	list-style: decimal;
    }
    DT {
	padding-top: 	1ex;
    }
    UL.doctools_toc,UL.doctools_toc UL, UL.doctools_toc UL UL {
	font:		normal 12pt/14pt sans-serif;
	list-style:	none;
    }
    LI.doctools_section, LI.doctools_subsection {
	list-style: 	none;
	margin-left: 	0em;
	text-indent:	0em;
	padding: 	0em;
    }
    PRE {
	display: 	block;
	font-family:	monospace;
	white-space:	pre;
	margin:		0%;
	padding-top:	0.5ex;
	padding-bottom:	0.5ex;
	padding-left:	1ex;
	padding-right:	1ex;
	width:		100%;
    }
    PRE.doctools_example {
	color: 		black;
	background: 	#f5dcb3;
	border:		1px solid black;
    }
    UL.doctools_requirements LI, UL.doctools_syntax LI {
	list-style: 	none;
	margin-left: 	0em;
	text-indent:	0em;
	padding:	0em;
    }
    DIV.doctools_synopsis {
	color: 		black;
	background: 	#80ffff;
	border:		1px solid black;
	font-family:	serif;
	margin-top: 	1em;
	margin-bottom: 	1em;
    }
    UL.doctools_syntax {
	margin-top: 	1em;
	border-top:	1px solid black;
    }
    UL.doctools_requirements {
	margin-bottom: 	1em;
	border-bottom:	1px solid black;
    }
--></style>
</head>
<!-- Generated from file 'html.man' by tcllib/doctools with format 'html'
   -->
<!-- html.n
   -->
<body><hr> [
   <a href="../../../../../../../../home">Tcllib Home</a>
&#124; <a href="../../../../toc.html">Main Table Of Contents</a>
&#124; <a href="../../../toc.html">Table Of Contents</a>
&#124; <a href="../../../../index.html">Keyword Index</a>
&#124; <a href="../../../../toc0.html">Categories</a>
&#124; <a href="../../../../toc1.html">Modules</a>
&#124; <a href="../../../../toc2.html">Applications</a>
 ] <hr>
<div class="doctools">
<h1 class="doctools_title">html(n) 1.5 tcllib &quot;HTML Generation&quot;</h1>
<div id="name" class="doctools_section"><h2><a name="name">Name</a></h2>
<p>html - Procedures to generate HTML structures</p>
</div>
<div id="toc" class="doctools_section"><h2><a name="toc">Table Of Contents</a></h2>
<ul class="doctools_toc">
<li class="doctools_section"><a href="#toc">Table Of Contents</a></li>
<li class="doctools_section"><a href="#synopsis">Synopsis</a></li>
<li class="doctools_section"><a href="#section1">Description</a></li>
<li class="doctools_section"><a href="#section2">Bugs, Ideas, Feedback</a></li>
<li class="doctools_section"><a href="#see-also">See Also</a></li>
<li class="doctools_section"><a href="#keywords">Keywords</a></li>
<li class="doctools_section"><a href="#category">Category</a></li>
</ul>
</div>
<div id="synopsis" class="doctools_section"><h2><a name="synopsis">Synopsis</a></h2>
<div class="doctools_synopsis">
<ul class="doctools_requirements">
<li>package require <b class="pkgname">Tcl 8.2</b></li>
<li>package require <b class="pkgname">html <span class="opt">?1.5?</span></b></li>
</ul>
<ul class="doctools_syntax">
<li><a href="#1"><b class="cmd">::html::author</b> <i class="arg">author</i></a></li>
<li><a href="#2"><b class="cmd">::html::bodyTag</b> <i class="arg">args</i></a></li>
<li><a href="#3"><b class="cmd">::html::cell</b> <i class="arg">param value</i> <span class="opt">?<i class="arg">tag</i>?</span></a></li>
<li><a href="#4"><b class="cmd">::html::checkbox</b> <i class="arg">name value</i></a></li>
<li><a href="#5"><b class="cmd">::html::checkSet</b> <i class="arg">key sep list</i></a></li>
<li><a href="#6"><b class="cmd">::html::checkValue</b> <i class="arg">name</i> <span class="opt">?<i class="arg">value</i>?</span></a></li>
<li><a href="#7"><b class="cmd">::html::closeTag</b></a></li>
<li><a href="#8"><b class="cmd">::html::default</b> <i class="arg">key</i> <span class="opt">?<i class="arg">param</i>?</span></a></li>
<li><a href="#9"><b class="cmd">::html::description</b> <i class="arg">description</i></a></li>
<li><a href="#10"><b class="cmd">::html::end</b></a></li>
<li><a href="#11"><b class="cmd">::html::eval</b> <i class="arg">arg</i> <span class="opt">?<i class="arg">args</i>?</span></a></li>
<li><a href="#12"><b class="cmd">::html::extractParam</b> <i class="arg">param key</i> <span class="opt">?<i class="arg">varName</i>?</span></a></li>
<li><a href="#13"><b class="cmd">::html::font</b> <i class="arg">args</i></a></li>
<li><a href="#14"><b class="cmd">::html::for</b> <i class="arg">start test next body</i></a></li>
<li><a href="#15"><b class="cmd">::html::foreach</b> <i class="arg">varlist1 list1</i> <span class="opt">?<i class="arg">varlist2 list2 ...</i>?</span> <i class="arg">body</i></a></li>
<li><a href="#16"><b class="cmd">::html::formValue</b> <i class="arg">name</i> <span class="opt">?<i class="arg">defvalue</i>?</span></a></li>
<li><a href="#17"><b class="cmd">::html::getFormInfo</b> <i class="arg">args</i></a></li>
<li><a href="#18"><b class="cmd">::html::getTitle</b></a></li>
<li><a href="#19"><b class="cmd">::html::h</b> <i class="arg">level string</i> <span class="opt">?<i class="arg">param</i>?</span></a></li>
<li><a href="#20"><b class="cmd">::html::h1</b> <i class="arg">string</i> <span class="opt">?<i class="arg">param</i>?</span></a></li>
<li><a href="#21"><b class="cmd">::html::h2</b> <i class="arg">string</i> <span class="opt">?<i class="arg">param</i>?</span></a></li>
<li><a href="#22"><b class="cmd">::html::h3</b> <i class="arg">string</i> <span class="opt">?<i class="arg">param</i>?</span></a></li>
<li><a href="#23"><b class="cmd">::html::h4</b> <i class="arg">string</i> <span class="opt">?<i class="arg">param</i>?</span></a></li>
<li><a href="#24"><b class="cmd">::html::h5</b> <i class="arg">string</i> <span class="opt">?<i class="arg">param</i>?</span></a></li>
<li><a href="#25"><b class="cmd">::html::h6</b> <i class="arg">string</i> <span class="opt">?<i class="arg">param</i>?</span></a></li>
<li><a href="#26"><b class="cmd">::html::hdrRow</b> <i class="arg">args</i></a></li>
<li><a href="#27"><b class="cmd">::html::head</b> <i class="arg">title</i></a></li>
<li><a href="#28"><b class="cmd">::html::headTag</b> <i class="arg">string</i></a></li>
<li><a href="#29"><b class="cmd">::html::html_entities</b> <i class="arg">string</i></a></li>
<li><a href="#30"><b class="cmd">::html::if</b> <i class="arg">expr1 body1</i> <span class="opt">?<b class="const">elseif</b> <i class="arg">expr2 body2 ...</i>?</span> <span class="opt">?<b class="const">else</b> <i class="arg">bodyN</i>?</span></a></li>
<li><a href="#31"><b class="cmd">::html::init</b> <span class="opt">?<i class="arg">list</i>?</span></a></li>
<li><a href="#32"><b class="cmd">::html::keywords</b> <i class="arg">args</i></a></li>
<li><a href="#33"><b class="cmd">::html::mailto</b> <i class="arg">email</i> <span class="opt">?<i class="arg">subject</i>?</span></a></li>
<li><a href="#34"><b class="cmd">::html::meta</b> <i class="arg">args</i></a></li>
<li><a href="#35"><b class="cmd">::html::meta_name</b> <i class="arg">args</i></a></li>
<li><a href="#36"><b class="cmd">::html::meta_equiv</b> <i class="arg">args</i></a></li>
<li><a href="#37"><b class="cmd">::html::meta_charset</b> <i class="arg">charset</i></a></li>
<li><a href="#38"><b class="cmd">::html::css</b> <i class="arg">href</i></a></li>
<li><a href="#39"><b class="cmd">::html::css-clear</b></a></li>
<li><a href="#40"><b class="cmd">::html::js</b> <i class="arg">href</i></a></li>
<li><a href="#41"><b class="cmd">::html::js-clear</b></a></li>
<li><a href="#42"><b class="cmd">::html::minorList</b> <i class="arg">list</i> <span class="opt">?<i class="arg">ordered</i>?</span></a></li>
<li><a href="#43"><b class="cmd">::html::minorMenu</b> <i class="arg">list</i> <span class="opt">?<i class="arg">sep</i>?</span></a></li>
<li><a href="#44"><b class="cmd">::html::nl2br</b> <i class="arg">string</i></a></li>
<li><a href="#45"><b class="cmd">::html::openTag</b> <i class="arg">tag</i> <span class="opt">?<i class="arg">param</i>?</span></a></li>
<li><a href="#46"><b class="cmd">::html::paramRow</b> <i class="arg">list</i> <span class="opt">?<i class="arg">rparam</i>?</span> <span class="opt">?<i class="arg">cparam</i>?</span></a></li>
<li><a href="#47"><b class="cmd">::html::passwordInput</b> <span class="opt">?<i class="arg">name</i>?</span></a></li>
<li><a href="#48"><b class="cmd">::html::passwordInputRow</b> <i class="arg">label</i> <span class="opt">?<i class="arg">name</i>?</span></a></li>
<li><a href="#49"><b class="cmd">::html::quoteFormValue</b> <i class="arg">value</i></a></li>
<li><a href="#50"><b class="cmd">::html::radioSet</b> <i class="arg">key sep list</i></a></li>
<li><a href="#51"><b class="cmd">::html::radioValue</b> <i class="arg">name value</i></a></li>
<li><a href="#52"><b class="cmd">::html::refresh</b> <i class="arg">seconds url</i></a></li>
<li><a href="#53"><b class="cmd">::html::row</b> <i class="arg">args</i></a></li>
<li><a href="#54"><b class="cmd">::html::select</b> <i class="arg">name param choices</i> <span class="opt">?<i class="arg">current</i>?</span></a></li>
<li><a href="#55"><b class="cmd">::html::selectPlain</b> <i class="arg">name param choices</i> <span class="opt">?<i class="arg">current</i>?</span></a></li>
<li><a href="#56"><b class="cmd">::html::set</b> <i class="arg">var val</i></a></li>
<li><a href="#57"><b class="cmd">::html::submit</b> <i class="arg">label</i> <span class="opt">?<i class="arg">name</i>?</span> <span class="opt">?<i class="arg">title</i>?</span></a></li>
<li><a href="#58"><b class="cmd">::html::tableFromArray</b> <i class="arg">arrname</i> <span class="opt">?<i class="arg">param</i>?</span> <span class="opt">?<i class="arg">pat</i>?</span></a></li>
<li><a href="#59"><b class="cmd">::html::tableFromList</b> <i class="arg">querylist</i> <span class="opt">?<i class="arg">param</i>?</span></a></li>
<li><a href="#60"><b class="cmd">::html::textarea</b> <i class="arg">name</i> <span class="opt">?<i class="arg">param</i>?</span> <span class="opt">?<i class="arg">current</i>?</span></a></li>
<li><a href="#61"><b class="cmd">::html::textInput</b> <i class="arg">name value args</i></a></li>
<li><a href="#62"><b class="cmd">::html::textInputRow</b> <i class="arg">label name value args</i></a></li>
<li><a href="#63"><b class="cmd">::html::varEmpty</b> <i class="arg">name</i></a></li>
<li><a href="#64"><b class="cmd">::html::while</b> <i class="arg">test body</i></a></li>
<li><a href="#65"><b class="cmd">::html::doctype</b> <i class="arg">id</i></a></li>
<li><a href="#66"><b class="cmd">::html::wrapTag</b> <i class="arg">tag</i> <span class="opt">?<i class="arg">text</i>?</span> <span class="opt">?<i class="arg">args</i>?</span></a></li>
</ul>
</div>
</div>
<div id="section1" class="doctools_section"><h2><a name="section1">Description</a></h2>
<p>The package <b class="package">html</b> provides commands that generate HTML.
These commands typically return an HTML string as their result. In
particular, they do not output their result to <b class="const">stdout</b>.</p>
<p>The command <b class="cmd">::html::init</b> should be called early to initialize
the module.  You can also use this procedure to define default values
for HTML tag parameters.</p>
<dl class="doctools_definitions">
<dt><a name="1"><b class="cmd">::html::author</b> <i class="arg">author</i></a></dt>
<dd><p><em>Side effect only</em>.  Call this before <b class="cmd">::html::head</b> to
define an author for the page.  The author is noted in a comment in
the HEAD section.</p></dd>
<dt><a name="2"><b class="cmd">::html::bodyTag</b> <i class="arg">args</i></a></dt>
<dd><p>Generate a <i class="term">body</i> tag.  The tag parameters are taken from <i class="arg">args</i> or
from the body.* attributes define with <b class="cmd">::html::init</b>.</p></dd>
<dt><a name="3"><b class="cmd">::html::cell</b> <i class="arg">param value</i> <span class="opt">?<i class="arg">tag</i>?</span></a></dt>
<dd><p>Generate a <i class="term">td</i> (or <i class="term">th</i>) tag, a value, and a closing
<i class="term">td</i> (or <i class="term">th</i>) tag. The
tag parameters come from <i class="arg">param</i> or TD.* attributes defined with
<b class="cmd">::html::init</b>.  This uses <b class="cmd">::html::font</b> to insert a standard
<i class="term">font</i> tag into the table cell. The <i class="arg">tag</i> argument defaults to &quot;td&quot;.</p></dd>
<dt><a name="4"><b class="cmd">::html::checkbox</b> <i class="arg">name value</i></a></dt>
<dd><p>Generate a <i class="term"><a href="../../../../index.html#checkbox">checkbox</a></i> form element with the specified name and value.
This uses <b class="cmd">::html::checkValue</b>.</p></dd>
<dt><a name="5"><b class="cmd">::html::checkSet</b> <i class="arg">key sep list</i></a></dt>
<dd><p>Generate a set of <i class="term"><a href="../../../../index.html#checkbox">checkbox</a></i> form elements and associated labels.  The
<i class="arg">list</i> should contain an alternating list of labels and values.
This uses <b class="cmd">::html::checkbox</b>. All the <i class="term"><a href="../../../../index.html#checkbox">checkbox</a></i> buttons share the
same <i class="arg">key</i> for their name. The <i class="arg">sep</i> is text used to separate
the elements.</p></dd>
<dt><a name="6"><b class="cmd">::html::checkValue</b> <i class="arg">name</i> <span class="opt">?<i class="arg">value</i>?</span></a></dt>
<dd><p>Generate the &quot;name=<i class="arg">name</i> value=<i class="arg">value</i>&quot; for a <i class="term"><a href="../../../../index.html#checkbox">checkbox</a></i> form
element.  If the CGI variable <i class="arg">name</i> has the value <i class="arg">value</i>,
then SELECTED is added to the return value. <i class="arg">value</i> defaults to
&quot;1&quot;.</p></dd>
<dt><a name="7"><b class="cmd">::html::closeTag</b></a></dt>
<dd><p>Pop a tag off the stack created by <b class="cmd">::html::openTag</b> and generate
the corresponding close tag (e.g., &lt;/body&gt;).</p></dd>
<dt><a name="8"><b class="cmd">::html::default</b> <i class="arg">key</i> <span class="opt">?<i class="arg">param</i>?</span></a></dt>
<dd><p>This procedure is used by <b class="cmd">::html::tagParam</b> to generate the name,
value list of parameters for a tag.  The <b class="cmd">::html::default</b>
procedure is used to generate default values for those items not
already in <i class="arg">param</i>.  If the value identified by <i class="arg">key</i> matches
a value in <i class="arg">param</i> then this procedure returns the empty string.
Otherwise, it returns a &quot;parameter=value&quot; string for a form element
identified by <i class="arg">key</i>.  The <i class="arg">key</i> has the form &quot;tag.parameter&quot;
(e.g., body.bgcolor).  Use <b class="cmd">::html::init</b> to register default
values. <i class="arg">param</i> defaults to the empty string.</p></dd>
<dt><a name="9"><b class="cmd">::html::description</b> <i class="arg">description</i></a></dt>
<dd><p><em>Side effect only</em>.  Call this before <b class="cmd">::html::head</b> to
define a description <i class="term">meta</i> tag for the page.  This tag is generated
later in the call to <b class="cmd">::html::head</b>.</p></dd>
<dt><a name="10"><b class="cmd">::html::end</b></a></dt>
<dd><p>Pop all open tags from the stack and generate the corresponding close
HTML tags, (e.g., &lt;/body&gt;&lt;/html&gt;).</p></dd>
<dt><a name="11"><b class="cmd">::html::eval</b> <i class="arg">arg</i> <span class="opt">?<i class="arg">args</i>?</span></a></dt>
<dd><p>This procedure is similar to the built-in Tcl <b class="cmd">eval</b> command.  The
only difference is that it returns &quot;&quot; so it can be called from an HTML
template file without appending unwanted results.</p></dd>
<dt><a name="12"><b class="cmd">::html::extractParam</b> <i class="arg">param key</i> <span class="opt">?<i class="arg">varName</i>?</span></a></dt>
<dd><p>This is a parsing procedure that extracts the value of <i class="arg">key</i> from
<i class="arg">param</i>, which is a HTML-style &quot;name=quotedvalue&quot; list.
<i class="arg">varName</i> is used as the name of a Tcl variable that is changed to
have the value found in the parameters.  The function returns 1 if the
parameter was found in <i class="arg">param</i>, otherwise it returns 0.  If the
<i class="arg">varName</i> is not specified, then <i class="arg">key</i> is used as the variable
name.</p></dd>
<dt><a name="13"><b class="cmd">::html::font</b> <i class="arg">args</i></a></dt>
<dd><p>Generate a standard <i class="term">font</i> tag.  The parameters to the tag are taken
from <i class="arg">args</i> and the HTML defaults defined with <b class="cmd">::html::init</b>.</p></dd>
<dt><a name="14"><b class="cmd">::html::for</b> <i class="arg">start test next body</i></a></dt>
<dd><p>This procedure is similar to the built-in Tcl <b class="cmd">for</b> control
structure.  Rather than evaluating the body, it returns the subst'ed
<i class="arg">body</i>. Each iteration of the loop causes another string to be
concatenated to the result value.</p></dd>
<dt><a name="15"><b class="cmd">::html::foreach</b> <i class="arg">varlist1 list1</i> <span class="opt">?<i class="arg">varlist2 list2 ...</i>?</span> <i class="arg">body</i></a></dt>
<dd><p>This procedure is similar to the built-in Tcl <b class="cmd"><a href="../../../../index.html#foreach">foreach</a></b> control
structure.  Rather than evaluating the body, it returns the subst'ed
<i class="arg">body</i>.  Each iteration of the loop causes another string to be
concatenated to the result value.</p></dd>
<dt><a name="16"><b class="cmd">::html::formValue</b> <i class="arg">name</i> <span class="opt">?<i class="arg">defvalue</i>?</span></a></dt>
<dd><p>Return a name and value pair, where the value is initialized from
existing CGI data, if any.  The result has this form:</p>
<pre class="doctools_example">
  name=&quot;fred&quot; value=&quot;freds value&quot;
</pre>
</dd>
<dt><a name="17"><b class="cmd">::html::getFormInfo</b> <i class="arg">args</i></a></dt>
<dd><p>Generate hidden fields to capture form values.  If <i class="arg">args</i> is
empty, then hidden fields are generated for all CGI values.  Otherwise
args is a list of string match patterns for form element names.</p></dd>
<dt><a name="18"><b class="cmd">::html::getTitle</b></a></dt>
<dd><p>Return the title string, with out the surrounding <i class="term">title</i> tag,
set with a previous call to <b class="cmd">::html::title</b>.</p></dd>
<dt><a name="19"><b class="cmd">::html::h</b> <i class="arg">level string</i> <span class="opt">?<i class="arg">param</i>?</span></a></dt>
<dd><p>Generate a heading (e.g., <i class="term">h<b class="variable">level</b></i>) tag.  The <i class="arg">string</i> is nested in the
heading, and <i class="arg">param</i> is used for the tag parameters.</p></dd>
<dt><a name="20"><b class="cmd">::html::h1</b> <i class="arg">string</i> <span class="opt">?<i class="arg">param</i>?</span></a></dt>
<dd><p>Generate an <i class="term">h1</i> tag.  See <b class="cmd">::html::h</b>.</p></dd>
<dt><a name="21"><b class="cmd">::html::h2</b> <i class="arg">string</i> <span class="opt">?<i class="arg">param</i>?</span></a></dt>
<dd><p>Generate an <i class="term">h2</i> tag.  See <b class="cmd">::html::h</b>.</p></dd>
<dt><a name="22"><b class="cmd">::html::h3</b> <i class="arg">string</i> <span class="opt">?<i class="arg">param</i>?</span></a></dt>
<dd><p>Generate an <i class="term">h3</i> tag.  See <b class="cmd">::html::h</b>.</p></dd>
<dt><a name="23"><b class="cmd">::html::h4</b> <i class="arg">string</i> <span class="opt">?<i class="arg">param</i>?</span></a></dt>
<dd><p>Generate an <i class="term">h4</i> tag.  See <b class="cmd">::html::h</b>.</p></dd>
<dt><a name="24"><b class="cmd">::html::h5</b> <i class="arg">string</i> <span class="opt">?<i class="arg">param</i>?</span></a></dt>
<dd><p>Generate an <i class="term">h5</i> tag.  See <b class="cmd">::html::h</b>.</p></dd>
<dt><a name="25"><b class="cmd">::html::h6</b> <i class="arg">string</i> <span class="opt">?<i class="arg">param</i>?</span></a></dt>
<dd><p>Generate an <i class="term">h6</i> tag.  See <b class="cmd">::html::h</b>.</p></dd>
<dt><a name="26"><b class="cmd">::html::hdrRow</b> <i class="arg">args</i></a></dt>
<dd><p>Generate a table row, including <i class="term">tr</i> and <i class="term">th</i> tags.
Each value in <i class="arg">args</i> is place into its own table cell.
This uses <b class="cmd">::html::cell</b>.</p></dd>
<dt><a name="27"><b class="cmd">::html::head</b> <i class="arg">title</i></a></dt>
<dd><p>Generate the <i class="term">head</i> section that includes the page <i class="term">title</i>.
If previous calls have been made to
<b class="cmd">::html::author</b>,
<b class="cmd">::html::keywords</b>,
<b class="cmd">::html::description</b>,
or
<b class="cmd">::html::meta</b>
then additional tags are inserted into the <i class="term">head</i> section.
This leaves an open <i class="term"><a href="../../../../index.html#html">html</a></i> tag pushed on the stack with
<b class="cmd">::html::openTag</b>.</p></dd>
<dt><a name="28"><b class="cmd">::html::headTag</b> <i class="arg">string</i></a></dt>
<dd><p>Save a tag for inclusion in the <i class="term">head</i> section generated by
<b class="cmd">::html::head</b>.  The <i class="arg">string</i> is everything in the tag except
the enclosing angle brackets, &lt; &gt;.</p></dd>
<dt><a name="29"><b class="cmd">::html::html_entities</b> <i class="arg">string</i></a></dt>
<dd><p>This command replaces all special characters in the <i class="arg">string</i> with
their HTML entities and returns the modified text.</p></dd>
<dt><a name="30"><b class="cmd">::html::if</b> <i class="arg">expr1 body1</i> <span class="opt">?<b class="const">elseif</b> <i class="arg">expr2 body2 ...</i>?</span> <span class="opt">?<b class="const">else</b> <i class="arg">bodyN</i>?</span></a></dt>
<dd><p>This procedure is similar to the built-in Tcl <b class="cmd">if</b> control
structure.  Rather than evaluating the body of the branch that is
taken, it returns the subst'ed <i class="arg">body</i>.  Note that the syntax is
slightly more restrictive than that of the built-in Tcl <b class="cmd">if</b>
control structure.</p></dd>
<dt><a name="31"><b class="cmd">::html::init</b> <span class="opt">?<i class="arg">list</i>?</span></a></dt>
<dd><p><b class="cmd">::html::init</b> accepts a Tcl-style name-value list that defines
values for items with a name of the form &quot;tag.parameter&quot;.  For
example, a default with key &quot;body.bgcolor&quot; defines the background
color for the <i class="term">body</i> tag.</p></dd>
<dt><a name="32"><b class="cmd">::html::keywords</b> <i class="arg">args</i></a></dt>
<dd><p><em>Side effect only</em>.  Call this before <b class="cmd">::html::head</b> to
define a keyword <i class="term">meta</i> tag for the page.  The <i class="term">meta</i> tag
is included in the result of <b class="cmd">::html::head</b>.</p></dd>
<dt><a name="33"><b class="cmd">::html::mailto</b> <i class="arg">email</i> <span class="opt">?<i class="arg">subject</i>?</span></a></dt>
<dd><p>Generate a hypertext link to a mailto: URL.</p></dd>
<dt><a name="34"><b class="cmd">::html::meta</b> <i class="arg">args</i></a></dt>
<dd><p>Compatibility name for <b class="cmd">html::meta_name</b>.</p></dd>
<dt><a name="35"><b class="cmd">::html::meta_name</b> <i class="arg">args</i></a></dt>
<dd><p><em>Side effect only</em>.
Call this before <b class="cmd">::html::head</b> to define a <i class="term">meta</i> tag for
the page.
The arguments (<i class="arg">args</i>) are a Tcl-style name, value list that is
used for the <b class="const">name=</b> and <b class="const">content=</b> attributes of the
<i class="term">meta</i> tag.  The <i class="term">meta</i> tag is included in the result of
<b class="cmd">::html::head</b>.</p></dd>
<dt><a name="36"><b class="cmd">::html::meta_equiv</b> <i class="arg">args</i></a></dt>
<dd><p><em>Side effect only</em>.
Call this before <b class="cmd">::html::head</b> to define a <i class="term">meta</i> tag for
the page.
The arguments (<i class="arg">args</i>) are a Tcl-style name, value list that is
used for the <b class="const">http-equiv=</b> and <b class="const">content=</b> attributes of
the <i class="term">meta</i> tag.  The <i class="term">meta</i> tag is included in the result of
<b class="cmd">::html::head</b>.</p></dd>
<dt><a name="37"><b class="cmd">::html::meta_charset</b> <i class="arg">charset</i></a></dt>
<dd><p><em>Side effect only</em>.
Call this before <b class="cmd">::html::head</b> to
define a <i class="term">meta</i> tag for the page.
The <i class="arg">charset</i> is used with the <b class="const">charset=</b> attribute of the
<i class="term">meta</i> tag.  The <i class="term">meta</i> tag is included in the result of
<b class="cmd">::html::head</b>.</p></dd>
<dt><a name="38"><b class="cmd">::html::css</b> <i class="arg">href</i></a></dt>
<dd><p><em>Side effect only</em>.  Call this before <b class="cmd">::html::head</b> to
define a <i class="term">link</i> tag for a linked CSS document.  The <i class="arg">href</i> 
value is a HTTP URL to a CSS document. The <i class="term">link</i> tag is included 
in the result of <b class="cmd">::html::head</b>.</p>
<p>Multiple calls of this command are allowed, enabling the use of
multiple CSS document references. In other words, the arguments
of multiple calls are accumulated, and do not overwrite each other.</p></dd>
<dt><a name="39"><b class="cmd">::html::css-clear</b></a></dt>
<dd><p><em>Side effect only</em>.  Call this before <b class="cmd">::html::head</b> to
clear all links to CSS documents.</p>
<p>Multiple calls of this command are allowed, doing nothing after the
first of a sequence with no intervening <b class="cmd">::html::css</b>.</p></dd>
<dt><a name="40"><b class="cmd">::html::js</b> <i class="arg">href</i></a></dt>
<dd><p><em>Side effect only</em>.  Call this before <b class="cmd">::html::head</b> to
define a <i class="term">script</i> tag for a linked JavaScript document.  The 
<i class="arg">href</i> is a HTTP URL to a JavaScript document. The <i class="term">script</i>
tag is included in the result of <b class="cmd">::html::head</b>.</p>
<p>Multiple calls of this command are allowed, enabling the use of
multiple JavaScript document references. In other words, the arguments
of multiple calls are accumulated, and do not overwrite each other.</p></dd>
<dt><a name="41"><b class="cmd">::html::js-clear</b></a></dt>
<dd><p><em>Side effect only</em>.  Call this before <b class="cmd">::html::head</b> to
clear all links to JavaScript documents.</p>
<p>Multiple calls of this command are allowed, doing nothing after the
first of a sequence with no intervening <b class="cmd">::html::js</b>.</p></dd>
<dt><a name="42"><b class="cmd">::html::minorList</b> <i class="arg">list</i> <span class="opt">?<i class="arg">ordered</i>?</span></a></dt>
<dd><p>Generate an ordered or unordered list of links.  The <i class="arg">list</i> is a
Tcl-style name, value list of labels and urls for the links.
<i class="arg">ordered</i> is a boolean used to choose between an ordered or
unordered list. It defaults to <b class="const">false</b>.</p></dd>
<dt><a name="43"><b class="cmd">::html::minorMenu</b> <i class="arg">list</i> <span class="opt">?<i class="arg">sep</i>?</span></a></dt>
<dd><p>Generate a series of hypertext links.  The <i class="arg">list</i> is a Tcl-style
name, value list of labels and urls for the links.  The <i class="arg">sep</i> is
the text to put between each link. It defaults to &quot; | &quot;.</p></dd>
<dt><a name="44"><b class="cmd">::html::nl2br</b> <i class="arg">string</i></a></dt>
<dd><p>This command replaces all line-endings in the <i class="arg">string</i> with a
<i class="term">br</i> tag and returns the modified text.</p></dd>
<dt><a name="45"><b class="cmd">::html::openTag</b> <i class="arg">tag</i> <span class="opt">?<i class="arg">param</i>?</span></a></dt>
<dd><p>Push <i class="arg">tag</i> onto a stack and generate the opening tag for
<i class="arg">tag</i>. Use <b class="cmd">::html::closeTag</b> to pop the tag from the
stack. The second argument provides any tag arguments, as a
list whose elements are formatted to be in the form
&quot;<b class="variable">key</b>=<b class="const">value</b>&quot;.</p></dd>
<dt><a name="46"><b class="cmd">::html::paramRow</b> <i class="arg">list</i> <span class="opt">?<i class="arg">rparam</i>?</span> <span class="opt">?<i class="arg">cparam</i>?</span></a></dt>
<dd><p>Generate a table row, including <i class="term">tr</i> and <i class="term">td</i> tags. Each value in
<i class="arg">list</i> is placed into its own table cell. This uses
<b class="cmd">::html::cell</b>. The value of <i class="arg">rparam</i> is used as parameter for
the <i class="term">tr</i> tag. The value of <i class="arg">cparam</i> is passed to <b class="cmd">::html::cell</b>
as parameter for the <i class="term">td</i> tags.</p></dd>
<dt><a name="47"><b class="cmd">::html::passwordInput</b> <span class="opt">?<i class="arg">name</i>?</span></a></dt>
<dd><p>Generate an <i class="term">input</i> tag of type <i class="term"><a href="../../../../index.html#password">password</a></i>. The <i class="arg">name</i> defaults to
&quot;password&quot;.</p></dd>
<dt><a name="48"><b class="cmd">::html::passwordInputRow</b> <i class="arg">label</i> <span class="opt">?<i class="arg">name</i>?</span></a></dt>
<dd><p>Format a table row containing a label and an <i class="term">input</i> tag of type
<i class="term"><a href="../../../../index.html#password">password</a></i>. The <i class="arg">name</i> defaults to &quot;password&quot;.</p></dd>
<dt><a name="49"><b class="cmd">::html::quoteFormValue</b> <i class="arg">value</i></a></dt>
<dd><p>Quote special characters in <i class="arg">value</i> by replacing them with HTML
entities for quotes, ampersand, and angle brackets.</p></dd>
<dt><a name="50"><b class="cmd">::html::radioSet</b> <i class="arg">key sep list</i></a></dt>
<dd><p>Generate a set of <i class="term">input</i> tags of type <i class="term">radio</i> and an associated text
label.  All the radio buttons share the same <i class="arg">key</i> for their name.
The <i class="arg">sep</i> is text used to separate the elements.  The <i class="arg">list</i>
is a Tcl-style label, value list.</p></dd>
<dt><a name="51"><b class="cmd">::html::radioValue</b> <i class="arg">name value</i></a></dt>
<dd><p>Generate the &quot;name=<i class="arg">name</i> value=<i class="arg">value</i>&quot; for a <i class="term">radio</i> form
element.  If the CGI variable <i class="arg">name</i> has the value <i class="arg">value</i>,
then SELECTED is added to the return value.</p></dd>
<dt><a name="52"><b class="cmd">::html::refresh</b> <i class="arg">seconds url</i></a></dt>
<dd><p>Set up a refresh <i class="term">meta</i> tag. Call this before <b class="cmd">::html::head</b> and the
HEAD section will contain a <i class="term">meta</i> tag that causes the document to
refresh in <i class="arg">seconds</i> seconds.  The <i class="arg">url</i> is optional.  If
specified, it specifies a new page to load after the refresh interval.</p></dd>
<dt><a name="53"><b class="cmd">::html::row</b> <i class="arg">args</i></a></dt>
<dd><p>Generate a table row, including <i class="term">tr</i> and <i class="term">td</i> tags.  Each value in
<i class="arg">args</i> is place into its own table cell. This uses
<b class="cmd">::html::cell</b>. Ignores any default information set up via
<b class="cmd">::html::init</b>.</p></dd>
<dt><a name="54"><b class="cmd">::html::select</b> <i class="arg">name param choices</i> <span class="opt">?<i class="arg">current</i>?</span></a></dt>
<dd><p>Generate a <i class="term">select</i> form element and nested <i class="term">option</i> tags. The <i class="arg">name</i>
and <i class="arg">param</i> are used to generate the <i class="term">select</i> tag. The <i class="arg">choices</i>
list is a Tcl-style name, value list.</p></dd>
<dt><a name="55"><b class="cmd">::html::selectPlain</b> <i class="arg">name param choices</i> <span class="opt">?<i class="arg">current</i>?</span></a></dt>
<dd><p>Like <b class="cmd">::html::select</b> except that <i class="arg">choices</i> is a Tcl list of
values used for the <i class="term">option</i> tags.  The label and the value for each
<i class="term">option</i> are the same.</p></dd>
<dt><a name="56"><b class="cmd">::html::set</b> <i class="arg">var val</i></a></dt>
<dd><p>This procedure is similar to the built-in Tcl <b class="cmd"><a href="../../../../index.html#set">set</a></b> command.  The
main difference is that it returns &quot;&quot; so it can be called from an HTML
template file without appending unwanted results.  The other
difference is that it must take two arguments.</p></dd>
<dt><a name="57"><b class="cmd">::html::submit</b> <i class="arg">label</i> <span class="opt">?<i class="arg">name</i>?</span> <span class="opt">?<i class="arg">title</i>?</span></a></dt>
<dd><p>Generate an <i class="term">input</i> tag of type <i class="term">submit</i>.
The <i class="arg">name</i> defaults to &quot;submit&quot;.
When a non-empty <i class="arg">title</i> string is specified the button gains a
<b class="const">title=</b> attribute with that value.</p></dd>
<dt><a name="58"><b class="cmd">::html::tableFromArray</b> <i class="arg">arrname</i> <span class="opt">?<i class="arg">param</i>?</span> <span class="opt">?<i class="arg">pat</i>?</span></a></dt>
<dd><p>Generate a two-column <i class="term"><a href="../../../../index.html#table">table</a></i> and nested rows to display a Tcl array. The
table gets a heading that matches the array name, and each generated row
contains a name, value pair. The array names are sorted (<b class="cmd">lsort</b> without
special options). The argument <i class="arg">param</i> is for the <i class="term"><a href="../../../../index.html#table">table</a></i> tag and has
to contain a pre-formatted string. The <i class="arg">pat</i> is a <b class="cmd">string match</b>
pattern used to select the array elements to show in the table. It defaults to
<b class="const">*</b>, i.e. the whole array is shown.</p></dd>
<dt><a name="59"><b class="cmd">::html::tableFromList</b> <i class="arg">querylist</i> <span class="opt">?<i class="arg">param</i>?</span></a></dt>
<dd><p>Generate a two-column <i class="term"><a href="../../../../index.html#table">table</a></i> and nested rows to display <i class="arg">querylist</i>,
which is a Tcl dictionary. Each generated row contains a name, value pair. The
information is shown in the same order as specified in the dictionary. The
argument <i class="arg">param</i> is for the <i class="term"><a href="../../../../index.html#table">table</a></i> tag  and has to contain a
pre-formatted string.</p></dd>
<dt><a name="60"><b class="cmd">::html::textarea</b> <i class="arg">name</i> <span class="opt">?<i class="arg">param</i>?</span> <span class="opt">?<i class="arg">current</i>?</span></a></dt>
<dd><p>Generate a <i class="term">textarea</i> tag wrapped around its current values.</p></dd>
<dt><a name="61"><b class="cmd">::html::textInput</b> <i class="arg">name value args</i></a></dt>
<dd><p>Generate an <i class="term">input</i> form tag with type <i class="term"><a href="../../../../index.html#text">text</a></i>.  This uses
<b class="cmd">::html::formValue</b>.  The args is any additional tag attributes
you want to put into the <i class="term">input</i> tag.</p></dd>
<dt><a name="62"><b class="cmd">::html::textInputRow</b> <i class="arg">label name value args</i></a></dt>
<dd><p>Generate an <i class="term">input</i> form tag with type <i class="term"><a href="../../../../index.html#text">text</a></i> formatted into a table row
with an associated label.  The args is any additional tag attributes
you want to put into the <i class="term">input</i> tag.</p></dd>
<dt><a name="63"><b class="cmd">::html::varEmpty</b> <i class="arg">name</i></a></dt>
<dd><p>This returns 1 if the named variable either does not exist or has the
empty string for its value.</p></dd>
<dt><a name="64"><b class="cmd">::html::while</b> <i class="arg">test body</i></a></dt>
<dd><p>This procedure is similar to the built-in Tcl <b class="cmd">while</b> control
structure.  Rather than evaluating the body, it returns the subst'ed
<i class="arg">body</i>.  Each iteration of the loop causes another string to be
concatenated to the result value.</p></dd>
<dt><a name="65"><b class="cmd">::html::doctype</b> <i class="arg">id</i></a></dt>
<dd><p>This procedure can be used to build the standard DOCTYPE
declaration string. It will return the standard declaration
string for the id, or throw an error if the id is not known.
The following id's are defined:</p>
<ol class="doctools_enumerated">
<li><p>HTML32</p></li>
<li><p>HTML40</p></li>
<li><p>HTML40T</p></li>
<li><p>HTML40F</p></li>
<li><p>HTML401</p></li>
<li><p>HTML401T</p></li>
<li><p>HTML401F</p></li>
<li><p>XHTML10S</p></li>
<li><p>XHTML10T</p></li>
<li><p>XHTML10F</p></li>
<li><p>XHTML11</p></li>
<li><p>XHTMLB</p></li>
</ol></dd>
<dt><a name="66"><b class="cmd">::html::wrapTag</b> <i class="arg">tag</i> <span class="opt">?<i class="arg">text</i>?</span> <span class="opt">?<i class="arg">args</i>?</span></a></dt>
<dd><p>A helper to wrap a <i class="arg">text</i> in a pair of open/close <i class="arg">tag</i>s.
The arguments (<i class="arg">args</i>) are a Tcl-style name, value list that is
used to provide attributes and associated values to the opening tag.
The result is a string with the open <i class="arg">tag</i> along with the optional
attributes, the optional text, and the closed tag.</p></dd>
</dl>
</div>
<div id="section2" class="doctools_section"><h2><a name="section2">Bugs, Ideas, Feedback</a></h2>
<p>This document, and the package it describes, will undoubtedly contain
bugs and other problems.
Please report such in the category <em>html</em> of the
<a href="http://core.tcl.tk/tcllib/reportlist">Tcllib Trackers</a>.
Please also report any ideas for enhancements you may have for either
package and/or documentation.</p>
<p>When proposing code changes, please provide <em>unified diffs</em>,
i.e the output of <b class="const">diff -u</b>.</p>
<p>Note further that <em>attachments</em> are strongly preferred over
inlined patches. Attachments can be made by going to the <b class="const">Edit</b>
form of the ticket immediately after its creation, and then using the
left-most button in the secondary navigation bar.</p>
</div>
<div id="see-also" class="doctools_section"><h2><a name="see-also">See Also</a></h2>
<p><a href="../htmlparse/htmlparse.html">htmlparse</a>, <a href="../ncgi/ncgi.html">ncgi</a></p>
</div>
<div id="keywords" class="doctools_section"><h2><a name="keywords">Keywords</a></h2>
<p><a href="../../../../index.html#checkbox">checkbox</a>, <a href="../../../../index.html#checkbutton">checkbutton</a>, <a href="../../../../index.html#form">form</a>, <a href="../../../../index.html#html">html</a>, <a href="../../../../index.html#radiobutton">radiobutton</a>, <a href="../../../../index.html#table">table</a></p>
</div>
<div id="category" class="doctools_section"><h2><a name="category">Category</a></h2>
<p>CGI programming</p>
</div>
</div></body></html>
